package com.yc.mybatis.damai.mapper;

import com.yc.mybatis.damai.bean.Orderitem;
import com.yc.mybatis.damai.bean.Orders;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.mapping.FetchType;

/**
 * Company 源辰信息
 *
 * @author navy
 * @date 2024/7/26
 * Email haijunzhou@hnit.edu.cn
 */
public interface OrderitemMapper {

    @Select("select * from dm_orderitem where id = #{id}")
    @Results(id="rm1",
    value = {
            @Result(column = "id", property = "id", id = true),
            @Result(column = "oid", property = "orders",
            one = @One(select = "com.yc.mybatis.damai.mapper.OrdersMapper.selectById",
                    fetchType = FetchType.LAZY))

    })
    Orderitem selectById(int id);

    Orderitem selectById1(int id);

    Orderitem selectById2(int id);

    void insert(Orderitem orderitem);


}
